<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>cube</title>
    <style>
        .cube-wrap{
            margin: 50px;
        }
        .cube-container{
            margin-left: 100px;
            width: 200px;
            height: 200px;
            position: relative;
            transform-style: preserve-3d;
            transform:rotateY(45deg) rotateX(-20deg) rotateZ(-20deg);
            transform-origin: left top;
        }
        .cube-container > div {
            width: 200px;
            height: 200px;
            position: absolute;
        }

        .up {
            background: yellow;
            transform: rotateX(90deg) translateZ(100px);
            border: 1px solid cyan;
        }

        .right {
            background: red;
            transform: rotateY(-90deg) translateZ(100px);
            border: 1px solid cyan;
        }

        .before {
            background: cyan;
            transform: translateZ(100px);
            border: 1px solid cyan;
        }

        @keyframes translate-frame {
            0% {
                transform: translate3d(5px,5px,0);
            }
            10% {
                transform: translate3d(10px,10px,0);
            }
            20% {
                transform:translate3d(15px,15px,0);
            }
            30% {
                transform: translate3d(20px,20px,0);
            }
            40% {
                transform: translate3d(25px,25px,0);
            }
            50% {
                transform:translate3d(30px,30px,0);
            }
            60% {
                transform:translate3d(-30px,-30px,0);
            }
            70% {
                transform:translate3d(-25px,-25px,0);
            }
            80% {
                transform: translate3d(-20px,-20px,0);
            }
            90% {
                transform: translate3d(-10px,10px,0);
            }
            100% {
                transform: translate3d(-5px,-5px,0);
            }
        }
        .cube-container{
            /*animation: translate-frame 1s linear infinite;*/
        }

    </style>
</head>
<body>
<div class="cube-wrap">
    <div class="cube-container">
        <div class="up"></div>
        <div class="right"></div>
        <div class="before"></div>
    </div>
</div>





</body>
</html>